<template>
  <a-modal v-model:visible="visible" title="权限管理" :footer="null" width="60%">
    <div class="px-8 py-4">
      <this-form @finished="finished" ref="formRef" />
    </div>
  </a-modal>
</template>
  <script lang="ts">
import { defineComponent, ref, nextTick } from 'vue';
import thisForm from './form.vue';

export default defineComponent({
  components: { thisForm },
  setup(props, { emit }) {
    const visible = ref<boolean>(false);
    const formRef = ref<any>();
    let uid;
    const open = (id) => {
      uid = id;
      visible.value = true;
      nextTick(() => {
        formRef.value.init(id);
      });
    };

    const finished = () => {
      visible.value = false;
      emit('updated');
    };

    return {
      visible,
      finished,
      open,
      formRef,
    };
  },
});
</script>
  
  